﻿using System;
using System.Collections.Generic;

using System.Text;
using QUANLYCHAMCONG.DAO.Core;
using System.Data;
using QUANLYCHAMCONG.BL.Entities;
using ModuleDALCore;
namespace QUANLYCHAMCONG.DAO.DAO
{
    public class TINHTOANDAO : DALBase
    {
        string SP = "SpHienThi";
        private string _SpName;
        public string SpName
        {
            get { return "SpTinhToan"; }
            set { _SpName = value; }
        }
        public TINHTOANDAO()
        {
            OpenConnect();
        }
        // ham thu nhat 
        public DataTable GIONGUON(BAOCAO bc)
        {
            try
            {
                return DBManager.Intance.ExecuteDataTable(SpName, ConvertClassToArray.GetParamName(bc, null), ConvertClassToArray.GetValues(bc, 0));
            }
            catch 
            {
                return null;
            }
        }
        public DataTable CHECKINOUT(BAOCAO bc)
        {
            try
            {
                return DBManager.Intance.ExecuteDataTable(SpName, ConvertClassToArray.GetParamName(bc, null), ConvertClassToArray.GetValues(bc, 1));
            }
            catch
            {
                return null;
            }
        }
        public DataTable TONGCONG(BAOCAO bc)
        {
            try
            {
                return DBManager.Intance.ExecuteDataTable(SpName, ConvertClassToArray.GetParamName(bc, null), ConvertClassToArray.GetValues(bc, 2));
            }
            catch
            {
                return null;
            }
        }
        public DataTable ThongkeTinhhinh(Thongke bc)
        {
            try
            {
                
                return DBManager.Intance.ExecuteDataTable(SP, ConvertClassToArray.GetParamName(bc, null), ConvertClassToArray.GetValues(bc, 1));
            }
            catch
            {
                return null;
            }
        }
        public DataTable ThongKeNeuKhongcodulieu(Thongke bc)
        {
            try
            {
                return DBManager.Intance.ExecuteDataTable(SP, ConvertClassToArray.GetParamName(bc, null), ConvertClassToArray.GetValues(bc, 2));
            }
            catch
            {
                return null;
            }
        }
        public DataTable ThongKeTotal(Thongke bc)
        {
            try
            {
                return DBManager.Intance.ExecuteDataTable(SP, ConvertClassToArray.GetParamName(bc, null), ConvertClassToArray.GetValues(bc, 0));
            }
            catch
            {
                return null;
            }
        }
        
    }
}
